home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / lib / linuxmint / mintWifi / mintWifi.py < prev   
Encoding:
Python Source  |  2007-02-13  |  1.4 KB  |  48 lines

  1. #!/usr/bin/env python
  2.  
  3. # MintWifi
  4. #    No Copyright (What for?) Clem <root@linuxmint.com>
  5. #
  6. # This program is free software; you can redistribute it and/or
  7. # modify it under the terms of the GNU General Public License
  8. # as published by the Free Software Foundation; Version 2
  9. # of the License.
  10.  
  11. try:
  12.     import os
  13.     import commands
  14.     import sys
  15.     import string
  16. except Exception, detail:
  17.     print detail
  18.     pass
  19.  
  20. # checking the card type
  21. print("-------------------------")
  22. print("* I. scanning WIFI PCI devices...")
  23. os.system("lspci | grep \"Network controller\" > /tmp/detected_wireless_devices")
  24. devices_file = open("/tmp/detected_wireless_devices")
  25. for device_item in devices_file.readlines():
  26.     deviceArray = device_item.split()
  27.     device = ' '.join(deviceArray[3:])
  28.     pci_id_line = commands.getoutput("lspci -n | grep " + deviceArray[0]) 
  29.     pci_id_array = pci_id_line.split()
  30.     pci_id = ' '.join(pci_id_array[2:])    
  31.     print "  -- " + device 
  32.     print "      ==> PCI ID = " + pci_id    
  33. print("-------------------------")
  34. print("* II. querying ndiswrapper...")
  35. os.system("ndiswrapper -l")    
  36. print("-------------------------")
  37. print("* III. querying iwconfig...")
  38. os.system("iwconfig")
  39. print("-------------------------")
  40. print("* IV. querying ifconfig...")
  41. os.system("ifconfig")
  42. print("-------------------------")
  43. print("* V. querying DHCP...")
  44. os.system("sudo dhclient")
  45. print("-------------------------")
  46. print("* VI. querying nslookup google.com...")
  47. os.system("nslookup google.com")
  48.